import { IFeidaoAiBrowserComponent } from '@dfeidao/atom-web/interfaces';
import nodejs from '@dfeidao/atom-web/msg/nodejs';

export default async function a004(fd: IFeidaoAiBrowserComponent) {
	// todo
	// 右新增数据
	const risk_po_name = fd.data.node.querySelector<HTMLInputElement>('[data-fname="risk_po_name"]').value;
	if (!risk_po_name) {
		alert('请输入风险点类型名称：');
		return;
	}

	const res = await nodejs<{ code: number; result: string; }>('risk_point/zj-000003/s002', {
		filter: {
			risk_po_name
		}
	});

	console.log("neirong==>", res);

	if (res.code === 1) {
		alert('保存成功');
		// window.location.reload();
	} else {
		alert('保存失败');
	}
}
